feat(workspaces): bulk-clear unmapped folders + clearer approval opt-out - #172
Merged
Merged
Conversation
Two UX gaps on the Workspaces tab and the meta-tool approval prompt.
Clear-all-unmapped:
The Workspaces tab lists folders connected clients have reported but that
aren't mapped to a FeatureSet yet (amber "Unmapped" cards). There was no way
to dismiss them in bulk. Adds a "Clear unmapped" action that forgets every
unmapped reported root in one go:
- SessionRootsRegistry::forget_unmapped_roots() drops the unmapped roots
from the in-memory registry. A session left with no roots is removed
entirely (with its resolution snapshot + probe throttle) so its next
tools/list re-probes the peer and the resolver re-fires
WorkspaceNeedsBinding — i.e. the "map this folder?" prompt is offered
again. Sessions still holding a mapped root are untouched.
- clear_unmapped_reported_roots Tauri command snapshots the bound roots
(same exact-match rule the UI uses to label a card "Unmapped"), clears
the rest, and emits SessionRootsChanged so the tab refreshes.
- Workspaces tab gains a "Clear unmapped" button (shown only while
counts.unmapped > 0) behind a confirm, with a toast that sets the
"you'll be asked again" expectation.
Approval opt-out visibility:
The "manage approval prompts" escape hatch on the meta-tool approval dialog
was an 11px muted link that was easy to miss. Promotes it to a bordered,
icon-led button above a divider so the path to turning these prompts off is
actually noticeable. Behavior is unchanged (deny + route to Built-in tab).
Tests: registry unit tests for forget_unmapped_roots (clears unmapped
sessions, keeps mixed sessions); a Workspaces test covering the button's
visibility and the confirm -> clear flow.
Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Two small UX gaps surfaced while using the Workspaces tab and the meta-tool approval prompt.
1. Clear all unmapped folders at once
The Workspaces tab lists folders connected clients reported but that aren't mapped to a FeatureSet yet (amber Unmapped cards). You could filter to them, but there was no way to dismiss them in bulk — and dismissing them is exactly how you get McpMux to re-offer the "map this folder?" prompt.
SessionRootsRegistry::forget_unmapped_roots()drops the unmapped roots from the in-memory session-roots registry. A session left with no roots is removed entirely (along with its resolution snapshot + probe throttle) so its nexttools/listre-probes the peer and the resolver re-firesWorkspaceNeedsBinding— i.e. the prompt appears again. Sessions still holding a mapped root are left untouched.clear_unmapped_reported_rootsTauri command snapshots the bound roots (same exact-match rule the UI uses to label a card "Unmapped"), clears the rest, and emitsSessionRootsChangedso the tab refreshes.2. Make the approval opt-out noticeable
The "manage approval prompts" escape hatch on the meta-tool approval dialog was an 11px muted link that was easy to miss. It's now a bordered, icon-led button above a divider so the path to turning these prompts off is actually visible. Behavior is unchanged (deny the current request, then route to the Built-in tab where the toggle lives).
Tests
forget_unmapped_roots— clears unmapped sessions (and resets their snapshot so the next resolve re-prompts), keeps mixed sessions that still hold a mapped root.WorkspacesClearUnmapped.test.tsx— the button only appears while there are unmapped folders, and confirming it callsclearUnmappedReportedRoots.Validation (local)
cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,pnpm typecheck,pnpm -r lint(0 errors), Rust unit tests, and the full vitest suite (200 passed) all pass.